package com.my.zidingyikongjian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import com.my.zidingyikongjian.R;

public class SixActivity extends AppCompatActivity implements View.OnClickListener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_six);

        initView();
    }

    private void initView() {
        findViewById(R.id.btn_draw_bezier).setOnClickListener(this);
        findViewById(R.id.btn_draw_finger_track).setOnClickListener(this);
        findViewById(R.id.btn_wavy_line).setOnClickListener(this);
        findViewById(R.id.btn_wavy_sz).setOnClickListener(this);
        findViewById(R.id.btn_six_the_three_one).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_draw_bezier: // 画贝塞尔曲线
                goIntent("1", DrawBzeierActivity.class);
                break;
            case R.id.btn_draw_finger_track: // 画手指轨迹
                goIntent("2", DrawFingerTrackActivity.class);
                break;
            case R.id.btn_wavy_line: // 可动贝塞尔
                goIntent("3", RQuadToActivity.class);
                break;
            case R.id.btn_wavy_sz: // 实战
                goIntent("4", TMJFActivity.class);
                break;
            case R.id.btn_six_the_three_one: // 三方引用
                goIntent("1", TheThreeActivity.class);
                break;
        }
    }

    private void goIntent(String flag, Class cla) {
        Intent intent = new Intent(SixActivity.this, cla);
        intent.putExtra("six", flag);
        startActivity(intent);
    }
}
